$(function(){
	$("#cancleBut").click(function(){
		parent.$('#dlg').window('close');
		parent.$(document.body).remove()
	});
	var codelength=$('#oldpass').width();
	$('#oldpass').validatebox({
	    required: true,
	    validType: {
	    	custom_remote:['/operator/checkPass',oldpass,'密码不正确']
	    },
	    tipPosition:'top',
	    delay:1000,
	    deltaX:codelength/4
	});
	//提交表单
	$("#submitBut").click(function(){
		$("#form").form('submit',{
			url:'/operator/updatePass',
			onSubmit:function(){
		        return $(this).form('validate');
		    },
		    success:function(data){
		    	var jdata=$.parseJSON(data); 
		        if(jdata.code==200){
		        	$.messager.alert('成功','保存成功','info',function(){
		        		parent.$('#dlg').window('close');
		        	});
		        }
		        else{
		        	$.messager.alert('失败',jdata.msg,'error');
		        }
		    }
		});
	})
})